/*
 * CreateTeam.java
 */

package nxtgeninventorysystem.View.Dialog;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import nxtgeninventorysystem.Controller.Actions;

/**
 * The dialog box that displays a field for creating a team.
 * @author Seraph Softworks
 */
public class CreateTeam extends GuiDialog {

    /** Creates new form DatabaseConfig */
    public CreateTeam(java.awt.Frame parent) {
        super(parent);
    }

    @Override
    public void resetFields() {
        teamNameValue.setText("");
    }

    @Override
    protected void initialize() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        javax.swing.JButton closeButton = new javax.swing.JButton();
        javax.swing.JButton okButton = new javax.swing.JButton();
        javax.swing.JLabel teamNameLabel = new javax.swing.JLabel();
        teamNameValue = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(nxtgeninventorysystem.Driver.class).getContext().getResourceMap(CreateTeam.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setMinimumSize(new java.awt.Dimension(265, 100));
        setName("Form"); // NOI18N
        setResizable(false);

        closeButton.setAction(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                dispose();
            }
        });
        closeButton.setText(resourceMap.getString("closeButton.text")); // NOI18N
        closeButton.setName("closeButton"); // NOI18N

        okButton.setAction(new AbstractAction() {
            public void actionPerformed(ActionEvent e) {
                Actions.person.doCreateTeam();
            }
        });
        okButton.setText(resourceMap.getString("okButton.text")); // NOI18N
        okButton.setName("okButton"); // NOI18N

        teamNameLabel.setText(resourceMap.getString("teamNameLabel.text")); // NOI18N
        teamNameLabel.setName("teamNameLabel"); // NOI18N

        teamNameValue.setName("teamNameValue"); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(26, 26, 26)
                        .addComponent(teamNameLabel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(teamNameValue, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(90, 90, 90)
                        .addComponent(okButton)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(closeButton)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(teamNameLabel)
                    .addComponent(teamNameValue, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(closeButton)
                    .addComponent(okButton))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField teamNameValue;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the teamNameValue
     */
    public String getTeamName() {
        return teamNameValue.getText();
    }

}
